/**
 * @作者 chengxinxiaofeng
 * @时间 2019年7月15日10:30:20
 */
package com.chinaunicom.tour.sys.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.chinaunicom.tour.sys.entity.AirplanTicket;
import com.chinaunicom.tour.sys.entity.BuyAirplanTicket;
import com.chinaunicom.tour.sys.mapper.AirplanTicketMapper;
import com.chinaunicom.tour.sys.mapper.BuyAirplanTicketMapper;
import com.chinaunicom.tour.sys.model.AirplanTicketModel;

@Service
public class AirplanTicketService {

    @Autowired
    AirplanTicketMapper AirplanTicketMapper;
    
    @Autowired
    BuyAirplanTicketMapper buyAirplanTicketMapper;

    public int add(AirplanTicket entity) {
        return AirplanTicketMapper.add(entity);
    }

    public int delete(String id) {
        return AirplanTicketMapper.delete(id);
    }

    public int update(AirplanTicket entity) {
        return AirplanTicketMapper.update(entity);
    }

    public AirplanTicket findById(String id) {
        return AirplanTicketMapper.findById(id);
    }

    public List<AirplanTicket> findList(AirplanTicketModel queryModel) {
        return AirplanTicketMapper.findList(queryModel);
    }

    public int pageQueryCount(AirplanTicketModel queryModel) {
        return AirplanTicketMapper.pageQueryCount(queryModel);
    }

    public List<AirplanTicket> pageQuery(AirplanTicketModel queryModel) {
        return AirplanTicketMapper.pageQuery(queryModel);
    }
    
    //查询当前登录用户购买机票列表
    public  List<BuyAirplanTicket> findListByUserId(String userId) {
        return buyAirplanTicketMapper.findListByUserId(userId);
    }

	public BuyAirplanTicket findTicketInfoById(String ticketId) {
	     return buyAirplanTicketMapper.findTicketInfoById(ticketId);
	}

}
